package com.lingyun.ucm.web.mvc.service.impl;

import com.lingyun.ucm.common.exception.ServiceException;
import com.lingyun.ucm.common.pojo.bean.ConfigAcquireFailLog;
import com.lingyun.ucm.web.mvc.dao.ConfigAcquireFailLogDao;
import com.lingyun.ucm.web.mvc.service.ConfigAcquireFailLogService;

import java.util.List;

/**
 * 
 * @author Terrence2013
 * 2018年1月24日 上午9:56:45
 * 读取配置失败记录日志服务
 */
public class ConfigAcquireFailLogServiceImpl implements ConfigAcquireFailLogService {
    private ConfigAcquireFailLogDao configAcquireFailLogDao = new ConfigAcquireFailLogDao();

    /**
     * 获取所有记录
     *
     * @return
     * @throws ServiceException
     */
    @Override
    public List<ConfigAcquireFailLog> listAll() throws ServiceException {
        List<ConfigAcquireFailLog> configAcquireFailLogList;
        try {
            configAcquireFailLogList = configAcquireFailLogDao.listAll();
        } catch (Exception e) {
            throw new ServiceException(e);
        }
        return configAcquireFailLogList;
    }

    @Override
    public int countFailLog() throws ServiceException {
        int num=0;
        try {
            num = configAcquireFailLogDao.count();
        } catch (Exception e) {
            throw new ServiceException(e);
        }
        return num;
    }
}
